package net.sppan.base.config;

import net.sppan.base.dao.EntityManageDaoService;
import net.sppan.base.service.IMgAwardService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class InitAwardEveryDayJob {
    private Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    IMgAwardService mgAwardService;

    @Autowired
    EntityManageDaoService entityManageDaoService;
    /**
     * 初始化每天的奖品数量
     * 每天凌晨0点1分刷新
     */
    //*/6 * * * * ?    0 22 16 * * ?
    @Scheduled(cron="0 1 0 * * ?")
    public void intAwardNumEveryDay(){
        logger.info("我正在刷新每天的奖品数量....start....");
        entityManageDaoService.intiAwardNum();
        logger.info("我正在刷新每天的奖品数量....end....");
    }

}
